]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
brightnessManager: Fix stepping up/down via shortcuts
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 3 Aug 2025 20:32:40 +0000 (22:32 +0200)
committerMarge Bot <marge-bot@gnome.org>
Tue, 5 Aug 2025 06:00:21 +0000 (06:00 +0000)
The `BrightnessScale.value` property was originally called `brightness`,
and the methods used for keyboard shortcuts somehow missed the name change.

As a result, the methods try to set the brightness to `undefined`, which
is out of range and thus fails.

Use the correct property name to fix the shortcuts.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8570
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3825>

js/misc/brightnessManager.js

index 406c9f2dd691f4c3e813f0afcc81f4b44ab106d7..4ca1752d095c8c02d9ea975d543cdd5f3f556f8e 100644 (file)
@@ -306,15 +306,15 @@ export const BrightnessScale = GObject.registerClass({
     }
 
     stepUp() {
-        this._setValue(Math.min(1.0, this._brightness + SCALE_VALUE_STEP));
+        this._setValue(Math.min(1.0, this._value + SCALE_VALUE_STEP));
     }
 
     stepDown() {
-        this._setValue(Math.max(0.0, this._brightness - SCALE_VALUE_STEP));
+        this._setValue(Math.max(0.0, this._value - SCALE_VALUE_STEP));
     }
 
     cycleUp() {
-        if (Math.abs(1.0 - this._brightness) < SCALE_VALUE_CHANGE_EPSILON)
+        if (Math.abs(1.0 - this._value) < SCALE_VALUE_CHANGE_EPSILON)
             this._setValue(0.0);
         else
             this.stepUp();